package com.haoshuang.zhouzhoubang.ui.adapter

import android.graphics.Color
import com.chad.library.adapter4.BaseQuickAdapter
import com.haoshuang.zhouzhoubang.R
import com.haoshuang.zhouzhoubang.databinding.ItemSkillLabelBinding
import com.haoshuang.zhouzhoubang.model.bean.SpreadMealDetail
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter


/**
 * 技能标签列表适配器(蓝色)
 *
 */
class ServiceMealLabelAdapter(data: MutableList<SpreadMealDetail.Attr.Data>):
    BaseBindingQuickAdapter<SpreadMealDetail.Attr.Data, ItemSkillLabelBinding>(data) {

    override fun onBindViewHolder(
        holder: BaseBindingHolder,
        position: Int,
        item: SpreadMealDetail.Attr.Data?
    ) {
        if (item == null) return
        val binding = ItemSkillLabelBinding.bind(holder.itemView)
        binding.tvSkill.text = item.suk
        if (item.isCheck==1){
            binding.tvSkill.setTextColor(Color.parseColor("#00B7F5"))
            binding.tvSkill.setBackgroundResource(R.drawable.bg_4l)
        }else{
            binding.tvSkill.setTextColor(Color.parseColor("#333333"))
            binding.tvSkill.setBackgroundResource(R.drawable.bg_4lh)
        }
    }
}